package leetcode;

public class MaximumValue {
    public static void main(String[] args) {
        char c = '2';
        System.out.println('2' - '0');
//        MaximumValue maximumValue = new MaximumValue();
//        System.out.println(maximumValue.maximumValue(new String[]{"ada23", "atwr", "5", "3", "aaaaaa"}));
    }

    public int maximumValue(String[] strs) {
        int ans = 0;
        for (String str : strs) {
            char[] chars = str.toCharArray();
            boolean is_container_letter = false;
            boolean is_container_number = false;
            for (char ch : chars) {
                if ('a' <= ch && ch <= 'z') {
                    is_container_letter = true;
                }
                if ('0' <= ch && ch <= '9') {
                    is_container_number = true;
                }
            }
            // 只要包含字母，就直接返回长度
            if (is_container_letter) {
                ans = Math.max(str.length(), ans);
            }
            // 只包含数字
            if (!is_container_letter && is_container_number) {
                ans = Math.max(Integer.parseInt(str), ans);
            }
        }
        return ans;
    }
}
